<script setup lang="ts">
import { ref } from "vue";

// import { postProjectList } from "/@/api/project";

let listData = ref([]);

// 请求表格数据
// const getTableData = async (obj: object = {}) => {
//   try {
//     const { code, data } = await postProjectList(obj);
//     if (code === 200) {
//       listData.value = data.list.map(item => {
//         return { date: item.createTime, name: item.projectName };
//       });
//     }
//   } catch (err) {
//     console.log(err);
//   }
// };

// getTableData();
</script>

<template>
  <div class="infinite">
    <ul class="top">
      <li>创建日期</li>
      <li>项目名称</li>
      <!-- <li>Star数量</li> -->
    </ul>
    <el-scrollbar class="wrap">
      <ul class="item">
        <li v-for="(item, index) in listData" :key="index">
          <span v-text="item.date"></span>
          <span v-text="item.name"></span>
          <!-- <span v-text="item.star"></span> -->
        </li>
      </ul>
    </el-scrollbar>
  </div>
</template>

<style lang="scss" scoped>
.infinite {
  .top {
    width: 95%;
    height: 40px;
    line-height: 40px;
    display: flex;
    margin: 0 auto;
    font-size: 14px;
    color: #909399;
    font-weight: 400;
    background: #fafafa;

    li {
      width: 50%;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .wrap {
    width: 95%;
    height: 180px;
    margin: 0 auto;
    // overflow-y: auto;
    .el-scrollbar__wrap {
      overflow-x: hidden;
    }
    li {
      height: 30px;
      line-height: 30px;
      display: flex;
      font-size: 15px;
    }

    span {
      width: 50%;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}
</style>
